home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Toolbox / Visual Basic Toolbox (P.I.E.)(1996).ISO / message / subcls / ownrdraw.bas < prev    next >
Encoding:
BASIC Source File  |  1995-05-30  |  2.2 KB  |  58 lines

  1. Option Explicit
  2.  
  3. ' Windows data types
  4. Type RECT
  5.     left As Integer
  6.     top As Integer
  7.     right As Integer
  8.     bottom As Integer
  9. End Type
  10.  
  11. Type DRAWITEMSTRUCT
  12.     CtlType As Integer
  13.     CtlID As Integer
  14.     itemID As Integer
  15.     itemAction As Integer
  16.     itemState As Integer
  17.     hwndItem As Integer
  18.     hDC As Integer
  19.     rcItem As RECT
  20.     itemData As Long
  21. End Type
  22.  
  23. Type MEASUREITEMSTRUCT
  24.     CtlType As Integer
  25.     CtlID As Integer
  26.     itemID As Integer
  27.     itemWidth As Integer
  28.     itemHeight As Integer
  29.     itemData As Long
  30. End Type
  31.  
  32. ' Windows declarations
  33. Declare Function GetMenu Lib "User" (ByVal hwnd As Integer) As Integer
  34. Declare Function GetSubMenu Lib "User" (ByVal hMenu As Integer, ByVal nPos As Integer) As Integer
  35. Declare Function ModifyMenu Lib "User" (ByVal hMenu As Integer, ByVal nPosition As Integer, ByVal wFlags As Integer, ByVal wIDNewItem As Integer, ByVal lpString As Any) As Integer
  36. Declare Function GetMenuItemID Lib "User" (ByVal hMenu As Integer, ByVal nPos As Integer) As Integer
  37. Declare Function CreateSolidBrush Lib "GDI" (ByVal crColor As Long) As Integer
  38. Declare Function SelectObject Lib "GDI" (ByVal hDC As Integer, ByVal hObject As Integer) As Integer
  39. Declare Function DeleteObject Lib "GDI" (ByVal hObject As Integer) As Integer
  40. Declare Function Rectangle Lib "GDI" (ByVal hDC As Integer, ByVal X1 As Integer, ByVal Y1 As Integer, ByVal X2 As Integer, ByVal Y2 As Integer) As Integer
  41. Declare Sub InflateRect Lib "User" (lpRect As RECT, ByVal X As Integer, ByVal Y As Integer)
  42. Declare Function FillRect Lib "User" (ByVal hDC As Integer, lpRect As RECT, ByVal hBrush As Integer) As Integer
  43. Declare Function GetSysColor Lib "User" (ByVal nIndex As Integer) As Long
  44. Declare Function GetSystemMetrics Lib "User" (ByVal nIndex As Integer) As Integer
  45. Declare Sub hmemcpy Lib "Kernel" (lpDest As Any, lpSource As Any, ByVal nCount As Long)
  46.  
  47. ' Windows constants
  48. Global Const ODS_SELECTED = &H1
  49. Global Const COLOR_MENU = 4
  50. Global Const COLOR_WINDOW = 5
  51. Global Const COLOR_HIGHLIGHT = 13
  52. Global Const MF_OWNERDRAW = &H100
  53. Global Const MF_BYCOMMAND = &H0
  54. Global Const SM_CYMENU = 15
  55. Global Const WM_DRAWITEM = &H2B
  56. Global Const WM_MEASUREITEM = &H2C
  57.  
  58.